<template>
   
     <el-container>
    <el-header style="text-align: left;flex-direction: row;display: flex;align-items: center; font-size: 12px">
        <el-form :inline="true" style="display: flex;flex-direction: row; margin-left: 10px;" class="demo-form-inline">
            <el-form-item>
                <el-input v-model="serch" placeholder="请输入搜索IMEI名称"></el-input>
                <el-date-picker
                    v-model="datestart"
                    type="date"
                    placeholder="选择日期范围">
                </el-date-picker>
                 <el-date-picker
                    v-model="dateend"
                    type="date"
                    placeholder="选择日期范围">
                </el-date-picker>
            </el-form-item>
        </el-form>

    </el-header>
    
    <el-main>
      <el-table :data="tableData" :cell-style="serchclick">
        <el-table-column  label="序号" width="100">
            <template slot-scope="scope">
            {{scope.$index+1}} 
          </template>
        </el-table-column>
        <el-table-column prop="imei" label="IMEI">
        </el-table-column>
        <el-table-column prop="name" label="用户名">
        </el-table-column>
        <el-table-column prop="project_name" label="所属项目">
        </el-table-column>
        
        <el-table-column prop="request_time" label="请求时间" >
        </el-table-column>
        <el-table-column prop="name" label="固件名称">
        </el-table-column>
        <el-table-column prop="version" label="设备版本">
        </el-table-column>
        <el-table-column prop="serviceversion" label="服务区版本">
        </el-table-column>
      </el-table>
    </el-main>
     </el-container>

</template>

<script>
    import {Axios} from "../../../static/util";
    
    export default {
        name:"ulog",
        methods: {
            serchclick({row,colnum,rowIndex,columnIndex}){
            //   console.log(1,this.serch,row['productname']);
                if((! row['imei'].includes(this.serch)) && this.serch != ''){
                  
                    return 'display:none';
                }
                
            }
        },
        data(){
           
            return {
                tableData: [],
                serch: '',
                datestart: '',
                dateend: "",
            };
        },
        created(){
            
            let self = this;
            Axios(
              'get',
              'http://127.0.0.1:5000/update_log',
              {},
              (res)=>{
              if (res.data.code != "200"){
                  this.$message.warning('错误:'+res.data.msg);
                  
              }else{
                this.tableData = res.data.data;
                
              }
                
            });
        }

    }
</script>

<style>
</style>
